<template>
  <!--:current-page 当前显示第几页的数据-->
  <!--:page-size 当前每页显示多少条数据-->
  <!--layout  要展示的功能组件-->
  <!--:total 总数据条数-->
  <el-pagination :current-page="obj.pagenum" :page-sizes="sizes" :page-size="obj.pagesize" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
</template>

<script>
export default {
  name: 'ElPag',
  props: {
    obj: {
      type: Object,
      required: true
    },
    total: {
      type: Number,
      default: 0
    },
    sizes: {
      type: Array,
      required: true
    }
  },
  data() {
    return {}
  },
  created() {},
  methods: {
    // 监听pagesize改变的事件
    handleSizeChange(newSize) {
      this.$emit('sizeChange', newSize)
    },
    // 监听页码值改变的事件
    handleCurrentChange(newPage) {
      this.$emit('currentChange', newPage)
    }
  }
}
</script>

<style lang='less' scoped>
</style>
